<template>
  <div class="emission-card">
    <div class="sort-index0" v-if="emissionItem.index === 1">{{ emissionItem.index }}</div>
    <div class="sort-index1" v-else-if="emissionItem.index === 2">{{ emissionItem.index }}</div>
    <div class="sort-index2" v-else-if="emissionItem.index === 3">{{ emissionItem.index }}</div>
    <div class="sort-index-other" v-else>{{ emissionItem.index + 1 }}</div>
    <div class="company-name">{{ emissionItem.companyName }}</div>
    <div class="company-num"><round :value="emissionItem.companyNum" /></div>
    <div class="company-unit">(kg/co2)</div>
  </div>
</template>

<script setup>
defineProps({
  emissionItem: {
    type: Object,
    require: true,
    default() {
      return {}
    }
  }
})
</script>

<style lang="scss" scoped>
.emission-card {
  width: 100%;
  height: 55px;
  margin-top: 11px;
  background: #103f447a;
  border-radius: 2px;
  border: 0px solid #3fffff;
  display: flex;
  align-items: center;
  padding-left: 12px;
  box-sizing: border-box;
  .sort-index0,
  .sort-index1,
  .sort-index2,
  .sort-index-other {
    width: 27px;
    height: 16px;
    background-size: 100% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-family: AlimamaShuHeiTi-Bold, AlimamaShuHeiTi;
    font-weight: bold;
    color: #fcf8f8;
  }

  .sort-index0 {
    background-image: url('@/assets/images/sort-1.png');
  }
  .sort-index1 {
    background-image: url('@/assets/images/sort-2.png');
  }
  .sort-index2 {
    background-image: url('@/assets/images/sort-3.png');
  }
  .sort-index-other {
    background-image: url('@/assets/images/sort-4.png');
  }
  .company-name {
    width: 170px;
    margin-right: 70px;
    margin-left: 8px;
    font-size: 12px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #fcf8f8;
  }
  .company-num {
    width: 64px;
    font-size: 12px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #3afcf8;
    margin-right: 10px;
  }
  .company-unit {
    width: 59px;
    font-size: 12px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #fcf8f8;
    margin-left: 3px;
  }
}
</style>